package models

import (
	"github.com/astaxie/beego/orm"
)

func init(){
	orm.RegisterModel(new(AdminUser),new(AdminAuthRule),new(AdminGroup),new(AdminLog),new(Files))
}

//获取mysql版本号
func MysqlVersion() string  {
	o := orm.NewOrm()
	var maps []orm.Params
	num, err := o.Raw("select VERSION() as version").Values(&maps)
	if err != nil && num > 0 {
		return ""
	}
	return maps[0]["version"].(string)
}